/*
 * @Autor: dc
 * @Date: 2022-03-01 14:41:03
 * @LastEditors: dc
 * @LastEditTime: 2022-03-28 16:40:39
 * @Description: 
 */
import React, { Component } from 'react';
import { Route, Switch,Redirect } from 'react-router-dom'
// 一般组件
import Header from "./components/Header"
// 路由组件
import About from "./pages/About"
import Home from "./pages/Home"
import MyNavLink from './components/MyNavLink'
import Test from './pages/Test'
import './App.css'
class App extends Component {
    render() {
        return (
            <div>
                <Header ></Header>
                <div>
                    <div className="center_div flex_start">
                        <div className='navgation'>
                            <MyNavLink to="/about">About</MyNavLink>
                            <MyNavLink to="/home?a=3">Home</MyNavLink>
                        </div>
                        <div className='conter flex_center'>
                            <Switch>
                                {/* exact 开启路由严格模式,默认是false关闭 */}
                                <Route path="/about" component={About} />
                                <Route path="/home" component={Home} />
                                {/*  路由重定向 */}
                                <Redirect to="/home"></Redirect>
                            </Switch>
                        </div>
                    </div>
                </div>
            </div>
        );
    }
}

export default (App);